function mapbigger(){
	var centerx
	var centery
	var newzoom
	var frametop
	var frameleft
	var tablewidth
	var tablehigh
	var picwidth
	var pichigh
	frametop=parseInt(document.all.mapframe.style.top)
	frameleft=parseInt(document.all.mapframe.style.left)
	tablehigh=parseInt(document.all.seltable.style.height)
	tablewidth=parseInt(document.all.seltable.style.width)
	tableleft=parseInt(document.all.seltable.style.left)
	tabletop=parseInt(document.all.seltable.style.top)
	picwidth=parseInt(document.all.imgmap.style.width)
	pichigh=parseInt(document.all.imgmap.style.height)
	centerx=tablewidth/2+tableleft-frameleft
	centery=tablehigh/2+tabletop-frametop
	if(tablewidth>tablehigh){
		newzoom=tablewidth/picwidth
	}
	else{
		newzoom=tablehigh/pichigh
	}
	if(newzoom==0){
		newzoom=0.5
	}
	chgmapsrc("rqutype=chgmapview&centerx="+centerx+"&centery="+centery+"&newzoom="+newzoom)
}

function mapsmaller(){
	var centerx
	var centery
	var frametop
	var frameleft
	frametop=parseInt(document.all.mapframe.style.top)
	frameleft=parseInt(document.all.mapframe.style.left)
	centerx=window.event.clientX-(frameleft+1)
	centery=window.event.clientY-(frametop+1)
	chgmapsrc("rqutype=chgmapview&centerx="+centerx+"&centery="+centery+"&newzoom=2")
}

function mappaner(){
	var centerx
	var centery
	var picwidth
	var pichigh
	var picleft
	var pictop
	picwidth=parseInt(document.all.imgmap.style.width)
	pichigh=parseInt(document.all.imgmap.style.height)
	pictop=parseInt(document.all.imgmap.style.top)
	picleft=parseInt(document.all.imgmap.style.left)
	if(pictop!=0&&picleft!=0){
		centerx=picwidth/2-picleft
		centery=pichigh/2-pictop
		chgmapsrc("rqutype=panmap&centerx="+centerx+"&centery="+centery)
		document.all.imgmap.style.left=0
		document.all.imgmap.style.top=0
	}
}

function mapsmallpaner(){
	var centerx
	var centery
	var frametop
	var frameleft
	var boundhigh
	var maphigh
	frametop=parseInt(document.all.mapboundframe.style.top)
	frameleft=parseInt(document.all.mapboundframe.style.left)
	centerx=window.event.clientX-(frameleft+1)
	centery=window.event.clientY-(frametop+1)
	chgmapsrc("rqutype=smallpanmap&centerx="+centerx+"&centery="+centery)
}

function mapreset(){
	chgmapsrc("rqutype=resetmap")
}

function mapbound(){
	if(document.all.mapboundframe.style.display=="none"){
		mapbounder()
		document.all.mapboundframe.style.display=""
		document.all.boundimg.src="images/index-map-a_08.jpg"
	}
	else{
		document.all.mapboundframe.style.display="none"
		document.all.boundimg.src="images/index-map_08.jpg"
	}
}

function mapbounder(){
	document.all.boundmap.src=mapboundserviceurl
}

function chgmapsrc(querystring){
	var locationurl
	locationurl="&oldx="+document.all.oldx.value+"&oldy="+document.all.oldy.value+"&oldzoom="+document.all.oldzoom.value
	document.all.imgmap.src=mapserviceurl+"?"+querystring+locationurl
}

function setlocation(){	
	center.document.location.reload()
	zoom.document.location.reload()
}

function show_info(){
		//alert(state)
		//alert(show_info_serviceurl)
		show_infoframe()
		
		/*
		if (oldx<400)
            document.all.infoframe.style.left =hintx;
        else
            document.all.infoframe.style.left =hintx-168;
  
  
        if (oldy<250)
            document.all.infoframe.style.top =hinty;
        else
            document.all.infoframe.style.top =hinty-205;
        */
         document.all.infoframe.style.left =hintx-45;
         document.all.infoframe.style.top =hinty+25;
         
		//document.all.infoframe.style.left=oldx+5
		//document.all.infoframe.style.top=oldy
		document.all.info.src=show_info_serviceurl+"&centerx="+oldx+"&centery="+oldy
		//window.open( show_info_serviceurl+"&centerx="+oldx+"&centery="+oldy)
}

function show_infoframe(){

//	if(document.all.infoframe.style.display=="none"){
		document.all.infoframe.style.display=""
//	}
//	else{
//		document.all.infoframe.style.display="none"
//	}

}

      function search(kpi){
	   //alert(top.leftFrame.document.forms(0).num.value);
	   top.menuIframe.document.forms(0).kpi.value=kpi;
	   top.menuIframe.document.forms(0).submit();
	  }
	  
